package cpaparser;
import java.util.Vector;

public class Relation
{
	String id;
	Vector <Member> members;
	Vector <Tag> tags;
	
	public Relation(String Id)
	{
		id = Id;
		members = new Vector<Member>();
		tags = new Vector<Tag>();
	}
	
	public void addMember(String type, String ref, String role)
	{
		members.add(new Member(type, ref, role));
	}
	
	public void addTag(String k, String v)
	{
		tags.add(new Tag(k, v));
	}
	
	public String getValue(String key)
	{
		for (int i = 0; i < tags.size(); i++)
		{
			if (tags.elementAt(i).k.equals(key))
				return tags.elementAt(i).v;
		}
		
		return null;
	}
}

